/* 五子棋在线对战游戏样式表 */

/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Microsoft YaHei", "PingFang SC", "SimHei", sans-serif;
}

body {
    background-color: #f5f5f5;
    color: #2C3E50;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: #3498DB;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn:hover {
    background-color: #2980B9;
    transform: scale(1.05);
}

.btn:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background-color: #3498DB;
}

.btn-success {
    background-color: #2ECC71;
}

.btn-danger {
    background-color: #E74C3C;
}

.btn-warning {
    background-color: #E67E22;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-control:focus {
    border-color: #3498DB;
    outline: none;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.5);
    transform: scale(1.02);
}

/* 登录和注册页面样式 */
.auth-container {
    max-width: 400px;
    margin: 50px auto;
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header h1 {
    font-size: 24px;
    color: #2C3E50;
    margin-top: 10px;
}

.auth-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 15px;
    display: block;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: #7f8c8d;
}

.auth-link {
    color: #3498DB;
    text-decoration: none;
    margin-top: 15px;
    display: inline-block;
}

.auth-link:hover {
    text-decoration: underline;
}

.error-message {
    color: #E74C3C;
    font-size: 14px;
    margin-top: 5px;
}

.success-message {
    color: #2ECC71;
    font-size: 14px;
    margin-top: 5px;
}

/* 游戏大厅样式 */
.hall-container {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 20px;
    min-height: calc(100vh - 40px);
}

.user-panel {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    height: fit-content;
}

.user-panel h2 {
    font-size: 20px;
    margin-bottom: 15px;
    color: #2C3E50;
    border-bottom: 2px solid #3498DB;
    padding-bottom: 10px;
}

.user-stats {
    margin-top: 20px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.stat-label {
    font-weight: 500;
}

.stat-value {
    font-weight: bold;
    color: #3498DB;
}

.matching-area {
    background-color: white;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.matching-btn {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background-color: #2ECC71;
    color: white;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 30px auto;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(46, 204, 113, 0.4);
    border: none;
}

.matching-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(46, 204, 113, 0.6);
}

.matching-btn.matching {
    background-color: #E67E22;
    animation: pulse 2s infinite;
}

.matching-btn.disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
    transform: none !important;
}

.matching-status {
    margin-top: 20px;
    font-size: 18px;
}

.timer {
    font-size: 24px;
    margin: 15px 0;
    font-weight: bold;
    color: #E67E22;
}

.history-panel {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    height: fit-content;
}

.history-panel h2 {
    font-size: 20px;
    margin-bottom: 15px;
    color: #2C3E50;
    border-bottom: 2px solid #3498DB;
    padding-bottom: 10px;
}

.history-list {
    max-height: 400px;
    overflow-y: auto;
}

.history-item {
    padding: 10px;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

.history-date {
    color: #7f8c8d;
    font-size: 12px;
}

.history-opponent {
    font-weight: 500;
    margin: 5px 0;
}

.history-result {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.win {
    color: #2ECC71;
    font-weight: bold;
}

.lose {
    color: #E74C3C;
    font-weight: bold;
}

.score-change {
    font-weight: bold;
}

.score-positive {
    color: #2ECC71;
}

.score-negative {
    color: #E74C3C;
}

.pagination {
    display: flex;
    justify-content: center;
    margin-top: 15px;
    gap: 5px;
}

.page-btn {
    padding: 5px 10px;
    background-color: #f1f1f1;
    border: 1px solid #ddd;
    cursor: pointer;
    border-radius: 3px;
    font-size: 14px;
}

.page-btn:hover {
    background-color: #e0e0e0;
}

.page-btn.active {
    background-color: #3498DB;
    color: white;
    border-color: #3498DB;
}

.page-btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

/* 顶部导航栏 */
.top-nav {
    background-color: #2C3E50;
    color: white;
    padding: 15px 0;
    margin-bottom: 20px;
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-size: 24px;
    font-weight: bold;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-username {
    font-size: 18px;
    font-weight: 500;
}

.nav-logout {
    background-color: #E74C3C;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.nav-logout:hover {
    background-color: #c0392b;
}

/* 游戏对战界面样式 */
.game-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background-color: #f5f5f5;
}

.game-info-bar {
    background-color: white;
    padding: 15px 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.player-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.player-name {
    font-size: 18px;
    font-weight: bold;
}

.player-score {
    color: #3498DB;
    font-size: 16px;
}

.player-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #333;
}

.player-color.black {
    background-color: #000;
}

.player-color.white {
    background-color: #fff;
}

.turn-indicator {
    background-color: #2ECC71;
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: bold;
}

.turn-indicator.waiting {
    background-color: #95a5a6;
}

.game-content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.board-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.game-board {
    background-color: #E9C46A;
    border: 3px solid #8B4513;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.board-grid {
    display: grid;
    grid-template-columns: repeat(15, 30px);
    grid-template-rows: repeat(15, 30px);
    gap: 0;
    background-image: 
        linear-gradient(to right, #333 1px, transparent 1px),
        linear-gradient(to bottom, #333 1px, transparent 1px);
    background-size: 30px 30px;
}

.board-cell {
    width: 30px;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    position: relative;
}

.board-cell:hover {
    background-color: rgba(52, 152, 219, 0.2);
}

.board-cell.disabled {
    cursor: not-allowed;
}

.piece {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid #333;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.piece.black {
    background-color: #000;
}

.piece.white {
    background-color: #fff;
}

.piece.last-move {
    border-color: #E74C3C;
    border-width: 3px;
}

.piece.preview {
    opacity: 0.5;
    transform: scale(0.8);
}

.piece.winning {
    animation: highlight 1s ease-in-out infinite alternate;
}

.game-controls {
    position: fixed;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    min-width: 150px;
}

.game-controls h3 {
    margin-bottom: 15px;
    color: #2C3E50;
}

.game-controls .btn {
    width: 100%;
    margin-bottom: 10px;
}

.game-timer {
    font-size: 20px;
    text-align: center;
    margin-bottom: 15px;
    color: #E67E22;
    font-weight: bold;
}

/* 游戏结果弹窗 */
.game-result-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.game-result {
    background-color: white;
    padding: 40px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: fadeIn 0.5s ease-in-out;
}

.result-title {
    font-size: 36px;
    font-weight: bold;
    margin-bottom: 20px;
}

.result-win {
    color: #2ECC71;
}

.result-lose {
    color: #E74C3C;
}

.score-change {
    font-size: 24px;
    margin: 15px 0;
    font-weight: bold;
}

.current-score {
    font-size: 18px;
    color: #7f8c8d;
    margin-bottom: 30px;
}

/* 加载和状态提示 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498DB;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.status-message {
    padding: 10px 15px;
    margin: 10px 0;
    border-radius: 4px;
    font-size: 14px;
}

.status-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.status-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .hall-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .game-controls {
        position: static;
        transform: none;
        margin-top: 20px;
        margin-left: 20px;
    }
    
    .game-content {
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    .hall-container {
        grid-template-columns: 1fr;
        padding: 10px;
    }
    
    .matching-btn {
        width: 150px;
        height: 150px;
        font-size: 18px;
    }
    
    .board-grid {
        grid-template-columns: repeat(15, 25px);
        grid-template-rows: repeat(15, 25px);
        background-size: 25px 25px;
    }
    
    .board-cell {
        width: 25px;
        height: 25px;
    }
    
    .piece {
        width: 22px;
        height: 22px;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes highlight {
    from {
        box-shadow: 0 0 5px #F1C40F;
    }
    to {
        box-shadow: 0 0 20px #F1C40F;
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

.bounce {
    animation: bounce 1s ease-in-out;
}

.spin {
    animation: spin 1s linear infinite;
}

/* 隐藏/显示 */
.hidden {
    display: none !important;
}

.invisible {
    visibility: hidden;
}

/* 工具类 */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.margin-top {
    margin-top: 20px;
}

.margin-bottom {
    margin-bottom: 20px;
}

.padding {
    padding: 20px;
}

.full-width {
    width: 100%;
} 